from django.db import models

# Create your models here.
from django.utils.six import python_2_unicode_compatible
from django.conf import settings

@python_2_unicode_compatible
class Product(models.Model):
    """
    产品
    """
    model = models.CharField(max_length=200)
    description = models.TextField()
    #产品实时价格
    price = models.DecimalField(max_digits=12,decimal_places=2)
    #销量
    sold = models.PositiveIntegerField(default=0)
    created = models.DateTimeField(auto_now_add=True)
    updated = models.DateTimeField(auto_now=True)
    def __str__(self):
        return self.model